package com.weitu.environmental.basicInfo.service.impl;

import com.weitu.environmental.basicInfo.entity.Sw;
import com.weitu.environmental.basicInfo.mapper.SwMapper;
import com.weitu.environmental.basicInfo.service.SwService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * @author zhangqingxi 2017-03-31
 */
@Service
public class SwServiceImpl implements SwService {

    private final SwMapper swMapper;

    @Autowired
    public SwServiceImpl(SwMapper swMapper) {
        this.swMapper = swMapper;
    }

    @Override
    public List<Sw> findByParam(Map paramMap) {
        return swMapper.findByParam(paramMap);
    }

    @Override
    public List<Map> findAllBySolidWasteTypeId(String solidWasteTypeId) {
        return swMapper.findAllBySolidWasteTypeId(solidWasteTypeId);
    }

    @Override
    public Integer findByParamCount(Map paramMap) {
        return swMapper.findByParamCount(paramMap);
    }

    @Override
    public Sw findById(String id) {
        return swMapper.findById(id);
    }

    @Transactional
    @Override
    public Integer add(Map paramMap) {
        return swMapper.add(paramMap);
    }

    @Transactional
    @Override
    public Integer updateById(Map paramMap) {
        return swMapper.updateById(paramMap);
    }


}
